package com.itheima.mArray;

import java.util.Random;

/*
    随机存储并打印
 */
public class ArrayWork03 {
    public static void main(String[] args) {
        int sum = 0;
        int[] arr = new int[6];
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(100);
            sum += arr[i];
        }
        System.out.println("元素和为:" + sum);

    }
}
